@layout("/common/_container.html"){
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<div class="form-horizontal" id="userDetail">
			<input type="hidden" id="id" value="${user.id!}">
			<div class="row">
				<div class="col-sm-6 b-r">
					<#input id="account" name="账户" underline="true" value="${user.account!}"/>
					<#select id="sex" name="性别" underline="true">
						<option value="1">男</option>
						<option value="2">女</option>
					</#select>
					@if(action=='add'){
						<#input id="password" name="密码" underline="true" type="password"/>
					@}
					<#input id="groupName" name="组织机构名称" readonly="readonly" hidden="groupId"
						click="userDetail.showGroupTree(); return false;"
						style="background-color: #ffffff !important;"
						ztreeFlag="true" ztreeDivId="ztreeDiv" ztreeId="zTree" ztreeStyle="width:244px !important;"
					 />
				</div>
				<div class="col-sm-6">
					<div id="driverInfoContent">
						<#input id="userName" name="用户名称" underline="true" value="${user.userName!}"/>
						<#input id="phone" name="手机号码" value="${user.phone!}" underline="true"/>
						@if(action=='add'){
							<#input id="rePassword" name="确认密码" type="password" underline="true"/>
						@}
						<#select id="roleId" name="角色名称" multiple="multiple"  > 
							@for(role in roleList){
								@if(isNotEmpty(user.roleList)){
									@	var arr = '';
									@for(srole in user.roleList){
									@	arr = srole.id + ',' +arr;
									@}
									@if(strutil.index(arr,role.id+'')>-1){
										<option value="${role.id}" selected>${role.roleName}</option>
									@}else{
										<option value="${role.id}">${role.roleName}</option>
									@}
								@}else{
									<option value="${role.id}">${role.roleName}</option>
								@}
							@}
						</#select>
					</div>
				</div>
			</div>
			<div class="row btn-group-m-t">
				<div class="col-sm-12 text-center">
					<#button btnCss="info" name="提交" id="ensure" icon="fa-check" click="userDetail.submit('${action}')"/> 
					<#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" click="userDetail.close()"/>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	var sex = '${user.sex!}';
	var groupId = '${user.sysGroup.id!}';
</script>
<script src="${ctxPath}/${adminPath}/user/userDetail.js"></script>
@}
